home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl,comp.lang.c,comp.lang.c++,comp.databases.sybase,comp.databases.oracle,comp.databases.informix,comp.databases.oracle
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!cronkite!news
- From: Marco DeFreitas <mdefreitas@sikorsky.com>
- Subject: Re: realloc equivalent in C++
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <1996Feb10.043730.10127@cronkite.res.utc.com>
- Sender: news@cronkite.res.utc.com
- Nntp-Posting-Host: iris604.asi.sikorsky.com
- Content-Transfer-Encoding: 7bit
- Organization: Sikorsky Aircraft
- References: <4fecgc$ar9@engr.orst.edu> <DMJ15v.13C@falcon.daytonoh.attgis.com> <4fgir1$pri@theory.tc.cornell.edu>
- Mime-Version: 1.0
- Date: Sat, 10 Feb 1996 04:37:30 GMT
- X-Mailer: Mozilla 1.1S (X11; I; IRIX 5.3 IP12)
- X-Url: news:4fgir1$pri@theory.tc.cornell.edu
-
- hzhou@r26n05.tc.cornell.edu (Honbo Zhou) wrote:
- >Is there anything in C++ equvalent to realloc in C which can be used
- >to increase allocated memory? Can't find this even in C++ books which
- >talk about memory management specifically. Thanks. Honbo
-
- If you "malloc" in C++, you can still "realloc". If, however, you are
- asking if there is a way to reallocate something that you did a "new"
- on, then the answer is no, unless you write your own reallocation
- function for your classes. My understanding as to why C++ does not
- allow a "re-new" is because you are not dealing with raw bits (like
- you are with a malloc), you are dealing with live objects which have
- constructors associated with them. That's all I know.
-
- --
- Regards,
- Marco DeFreitas
- Sikorsky Aircraft
- Stratford, CT
-
-